﻿using FinScreen.Model;
using System.Linq;

namespace FinScreen
{
    class Statistics
    {
        public double UpStockCount { get; private set; }
        public double DownStockCount { get; private set; }
        public double UpDownStockRatio
        {
            get { return DownStockCount == 0d ? 0d : UpStockCount / DownStockCount; }
        }

        internal void OnQuant(Instrument p)
        {
            if (p.Quotes.Last().PctChange > 0)
                UpStockCount++;
            if (p.Quotes.Last().PctChange < 0)
                DownStockCount++;
        }
    }
}
